import express, { Router } from 'express';
import path from 'path';
import userRoutes from './user.routes';
import uploadRoutes from './upload.routes';
import articleRoutes from './article.routes';

const router = Router();

// 健康检查路由
router.get('/health', (req, res) => {
  res.status(200).json({
    status: 'success',
    message: 'Server is running',
  });
});

// 用户相关路由
router.use('/users', userRoutes);

// 文件上传路由
router.use('/upload', uploadRoutes);

// 文章相关路由
router.use('/articles', articleRoutes);

// 其他路由可以在这里添加
// router.use('/other', otherRoutes);

// 404 处理
router.use((req, res) => {
  res.status(404).json({
    status: 'error',
    message: 'Not Found',
  });
});

export default router; 